-
Notifications
You must be signed in to change notification settings - Fork 315
Fix OverflowError: Python int too large to convert to C long raised during annotation label map creation with custom labels.
#548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
e3a23f4 to
43cf077
Compare
OverflowError: Python int too large to convert to C long raised during annotation label map creation with custom labels.
|
Pandas is Greek to me. What is the issue this is trying to solve?
What integer value is too large to convert to long? Annotation *type codes* can't be too large; those must be between 1 and 49.
|
|
@bemoody this is to fix the test error currently seen in #544. My understanding is that this is a known issue when Pandas tries to unify data types. Here is the explanation (along with the full test error): WFDB’s own constraints keep label_store small (1–49), so it isn’t your annotation values that are “too big.” The overflow comes from pandas’ internal attempt to unify dtypes when a row assignment ends up behaving like an append under the hood. On some platforms/pandas versions, that path tries to convert Python ints through a C long and can raise OverflowError even if your data are reasonable. |
|
The problem seems to be related to I'd suggest that we've gotten what benefit we can out of As for |
|
@bemoody , thanks for looking into this. It does seem like it is probably related to pandas-dev/pandas#60023. I'd be fine with removing |
The patch makes the label‑store dtype explicit (int64) and replaces row‑wise .loc assignment with a keyed, vectorized update.